import javax.swing.JPanel;
import java.awt.Graphics;
import java.awt.event.KeyListener;
import java.awt.image.BufferedImage;
import java.awt.event.MouseAdapter;

abstract class GameState
{
	protected JPanel display;
	protected JPanel overlay;
	protected BufferedImage displayDB;
	protected BufferedImage overlayDB;
	protected Graphics osd;
	protected Graphics oso;
	protected KeyListener keyListen;
	protected MouseAdapter mouseListen;
	
	public abstract String getName();
	public abstract void init();
	public abstract void render();
	public abstract void update();
	public abstract void enter();
	public abstract void leave();
	
	public final JPanel getDisplay()
	{
		return display;
	}
	
	public final void setDisplay(JPanel jp)
	{
		display = jp;
		displayDB = new BufferedImage(display.getWidth(),display.getHeight(),BufferedImage.TYPE_INT_ARGB);
		osd = displayDB.getGraphics();
	}
	
	public final JPanel getOverlay()
	{
		return overlay;
	}
	
	public final void setOverlay(JPanel jp)
	{
		overlay = jp;
		overlayDB = new BufferedImage(overlay.getWidth(),overlay.getHeight(),BufferedImage.TYPE_INT_ARGB);
		oso = overlayDB.getGraphics();
	}
	
	public final KeyListener getKeyListener()
	{
		return keyListen;
	}
	
	public final MouseAdapter getMouseListener()
	{
		return mouseListen;
	}
}
